package com.chen.common.exception;

/**
 * @author chenzy
 * @since 2023/3/10
 **/
public class Throw {
    private Throw(){}
    public static void error(CodeThrow exceptionCode,String msg){
        throw new BaseException(exceptionCode,msg,true);
    }
    public static void error(String msg){
        throw new BaseException(CodeThrow.Fail,msg,true);
    }
    public static BaseException errorGet(String msg, Exception e) {
        return new BaseException(CodeThrow.Fail,msg,e);
    }
    public static BaseException errorGet(String msg) {
        return new BaseException(CodeThrow.Fail,msg);
    }

    public static BaseException errorGet(CodeThrow exceptionCode, Throwable throwable) {
        return new BaseException(exceptionCode,throwable);
    }
    public static BaseException errorGet(CodeThrow exceptionCode,String msg, Throwable throwable) {
        return new BaseException(exceptionCode,msg,throwable);
    }
    public static BaseException errorGet(CodeThrow codeThrow, String msg) {
        return new BaseException(codeThrow,msg);
    }
}
